<?php
namespace app\mobile\model;

/**
 * Class GoodsType
 * @package app\mobile\model     平台商品栏目表
 */
class GoodsType extends BaseModel
{
    public function goods()
    {
        return $this->hasMany('ShopGoods', 'id', 'goods_id')->field('id,thumb_img,price,rebate_percentage')->order(['sale_number' => 'desc'])->limit('10');
    }
    public function getPicUrlAttr($value){
        return $value?$value:'/static/mobile/img/empty_img.png';
    }
}